import { lazy } from 'react';
import { Manager, WapHome, Cart,Diamond } from '@react-vant/icons';
export const mainRoute = [
    {
        path:'/Home/Index',
        element:lazy(()=>import('../Page/Home/Index')),
        txt:'首页',
        icon:WapHome
    },
    {
        path:'/Home/Classify',
        element:lazy(()=>import('../Page/Home/Classify')),
        txt:'分类',
        icon:Diamond
    },
    {
        path:'/Home/ClassItem',
        element:lazy(()=>import('../Page/Home/ClassItem')),
        txt:'上拉',
        icon:Diamond
    },
    {
        path:'/Home/Shop',
        element:lazy(()=>import('../Page/Home/Shop')),
        txt:'购物车',
        icon:Cart
    },
    {
        path:'/Home/My',
        element:lazy(()=>import('../Page/Home/My')),
        txt:'我的',
        icon:Manager
    },
]

const routers = [
    {
        path:'/Home',
        element:lazy(()=>import('../Page/Home')),
        children:mainRoute
    },
    {
        path:'/Detail/:id',
        element:lazy(()=>import('../Page/Detail'))
    },
    {
        path:'/Login',
        element:lazy(()=>import('../Page/Login'))
    },
    {
        path:'/Search',
        element:lazy(()=>import('../Page/Search'))
    },
    {
        path:'/SearchList',
        element:lazy(()=>import('../Page/SearchList'))
    },
    {
        path:'*',
        element:lazy(()=>import('../Page/Erroy404'))
    },
    {
        path:'/',
        to:'/Home/Index'
    }
]

export default routers